package com.z.work.controller;


import com.z.base.PageTableRequest;
import com.z.base.Results;
import com.z.sys.model.User;
import com.z.work.service.IStatisticsModelService;
import com.z.work.service.IStatisticsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zxy
 * @since 2022-01-06
 */
@Controller
@RequestMapping("/work/statistics")
public class StatisticsController {

    @Autowired
    private IStatisticsService statisticsService;
    @GetMapping("list")
    @ApiOperation("工作统计列表分页查询")
    @ResponseBody
    public Results list(PageTableRequest page) {
        page.countOffset();
        Results<User> results =Results.success(statisticsService.count(),statisticsService.list());
        return results;
    }
}
